linux 什么是Docker Machine?

葫芦的运维日志

下一篇 搜索 上一篇

浏览量 2663

2021/06/25 16:26


What is Docker Machine?

什么是Docker Machine?

Docker Machine is a tool that lets you install Docker Engine on virtual hosts, and manage the hosts with docker-machine commands. You can use Machine to create Docker hosts on your local Mac or Windows box, on your company network, in your data center, or on cloud providers like Azure, AWS, or DigitalOcean.

Using docker-machine commands, you can start, inspect, stop, and restart a managed host, upgrade the Docker client and daemon, and configure a Docker client to talk to your host.

Point the Machine CLI at a running, managed host, and you can run docker commands directly on that host. For example, run docker-machine env default to point to a host called default, follow on-screen instructions to complete env setup, and run docker ps, docker run hello-world, and so forth.

Machine was the only way to run Docker on Mac or Windows previous to Docker v1.12. Starting with the beta program and Docker v1.12, Docker Desktop for Mac and Docker Desktop for Windows are available as native apps and the better choice for this use case on newer desktops and laptops. We encourage you to try out these new apps.

If you aren’t sure where to begin, see Get Started with Docker, which guides you through a brief end-to-end tutorial on Docker.

Docker Machine是一个工具,可以让你在虚拟主机上安装Docker引擎,并使用Docker - Machine命令管理主机。您可以使用Machine在您的本地Mac或Windows机器上、在您的公司网络上、在您的数据中心上,或在Azure、AWS或DigitalOcean等云提供商上创建Docker主机。

使用Docker -machine命令,您可以启动、检查、停止和重新启动被管理的主机,升级Docker客户端和守护进程,并配置Docker客户端与您的主机通信。

将Machine CLI指向一个正在运行的托管主机,您就可以在该主机上直接运行docker命令。例如,运行docker-machine env default指向一个名为default的主机,按照屏幕上的说明完成env设置,并运行docker ps, docker运行hello-world,等等。

在Docker v1.12之前,机器是在Mac或Windows上运行Docker的唯一方式。从测试版和Docker v1.12开始,Mac版Docker Desktop和Windows版Docker Desktop都是原生应用,在新的台式机和笔记本电脑上是更好的选择。我们鼓励你尝试这些新的应用程序。

如果你不确定从哪里开始,请参阅Get Started with Docker,它会通过一个关于Docker的简单的端到端教程来指导你。

Why should I use it?

我为什么要使用它?

Docker Machine enables you to provision multiple remote Docker hosts on various flavors of Linux.

Additionally, Machine allows you to run Docker on older Mac or Windows systems, as described in the previous topic.

Docker Machine has these two broad use cases.

I have an older desktop system and want to run Docker on Mac or Windows

Docker Machine使您能够在不同风格的Linux上提供多个远程Docker主机。

此外,Machine允许您在旧的Mac或Windows系统上运行Docker,如前面所述。

Docker Machine有这两个广泛的用例。

我的桌面系统比较旧,我想在Mac或Windows上运行Docker

If you work primarily on an older Mac or Windows laptop or desktop that doesn’t meet the requirements for the new Docker Desktop for Mac and Docker Desktop for Windows apps, then you need Docker Machine to run Docker Engine locally.

I want to provision Docker hosts on remote systems

如果你主要在旧的Mac或Windows笔记本电脑或台式机上工作,不符合新的Docker Desktop for Mac和Docker Desktop for Windows应用程序的要求,那么你需要Docker Machine来在本地运行Docker Engine。

我想在远程系统上配置Docker主机

Docker Engine runs natively on Linux systems. If you have a Linux box as your primary system, and want to run docker commands, all you need to do is download and install Docker Engine. However, if you want an efficient way to provision multiple Docker hosts on a network, in the cloud or even locally, you need Docker Machine.

Whether your primary system is Mac, Windows, or Linux, you can install Docker Machine on it and use docker-machine commands to provision and manage large numbers of Docker hosts. It automatically creates hosts, installs Docker Engine on them, then configures the docker clients. Each managed host (“machine”) is the combination of a Docker host and a configured client.

Docker引擎在Linux系统上本地运行。如果你有一个Linux机器作为你的主要系统,并且想要运行docker命令,你所需要做的就是下载并安装docker引擎。但是,如果你想在网络上、云上甚至本地提供多个Docker主机,你需要Docker Machine。

无论你的主系统是Mac、Windows还是Linux,你都可以在上面安装Docker Machine,并使用Docker - Machine命令来提供和管理大量的Docker主机。它自动创建主机,在主机上安装Docker Engine,然后配置Docker客户端。每个托管主机(“机器”)是一个Docker主机和一个配置的客户机的组合。

What’s the difference between Docker Engine and Docker Machine?

Docker Engine和Docker Machine的区别是什么?

When people say “Docker” they typically mean Docker Engine, the client-server application made up of the Docker daemon, a REST API that specifies interfaces for interacting with the daemon, and a command line interface (CLI) client that talks to the daemon (through the REST API wrapper). Docker Engine accepts docker commands from the CLI, such as docker run , docker ps to list running containers, docker image ls to list images, and so on.

当人们说“Docker”时,他们通常指的是Docker引擎,即由Docker守护进程、指定与守护进程交互接口的REST API和与守护进程(通过REST API包装器)通信的命令行接口(CLI)客户端组成的客户机-服务器应用程序。Docker Engine从CLI接受Docker命令,如Docker run , Docker ps列出运行的容器,Docker image ls列出镜像,等等。

Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them). Typically, you install Docker Machine on your local system. Docker Machine has its own command line client docker-machine and the Docker Engine client, docker. You can use Machine to install Docker Engine on one or more virtual systems. These virtual systems can be local (as when you use Machine to install and run Docker Engine in VirtualBox on Mac or Windows) or remote (as when you use Machine to provision Dockerized hosts on cloud providers). The Dockerized hosts themselves can be thought of, and are sometimes referred to as, managed “machines”.

Docker Machine是一个用于配置和管理Dockerized主机(主机上有Docker引擎)的工具。通常,您在本地系统上安装Docker Machine。Docker Machine有自己的命令行客户端Docker - Machine和Docker Engine客户端Docker。您可以使用Machine在一个或多个虚拟系统上安装Docker Engine。这些虚拟系统可以是本地的(当您使用Machine在Mac或Windows上的VirtualBox中安装和运行Docker引擎时),也可以是远程的(当您使用Machine在云提供商上提供Dockerized主机时)。Dockerized的主机本身可以被认为是,有时也被称为托管的“机器”。

Install Docker.

Download the Docker Machine binary and extract it to your PATH.

If you are running macOS:

 base=https://github.com/docker/machine/releases/download/v0.16.0 \
  && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-machine \
  && chmod +x /usr/local/bin/docker-machine

If you are running Linux:

 base=https://github.com/docker/machine/releases/download/v0.16.0 \
  && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine \
  && sudo mv /tmp/docker-machine /usr/local/bin/docker-machine \
  && chmod +x /usr/local/bin/docker-machine

葫芦的运维日志

打赏

上一篇 搜索 下一篇
© 冰糖葫芦甜(bthlt.com) 2021 王梓打赏联系方式 陕ICP备17005322号-1